package com.nf.health.app.activity.home.view;

import android.content.Context;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.nf.health.app.R;
import com.nf.health.app.activity.home.bean.SatisfactionSurveyQuestionBean;

/**
 * Created by he_pan on 2017/4/12.
 * The only genius that is worth anything is the genius for hard work
 *
 * @author he_pan
 * @Description 4 单文本
 */

public class SimpleTextView extends BaseSelectView {


    protected TextView tvQuestionTitle;
    protected EditText etMessage;

    public SimpleTextView(Context context, SatisfactionSurveyQuestionBean bean, int position) {
        super(context,bean,position);
        initView();
        setUpView();
    }

    protected void initView() {
        View v = inflater.from(context).inflate(R.layout.item_survey_simple_text, this);
        tvQuestionTitle = (TextView) v.findViewById(R.id.tv_question_title);
        etMessage = (EditText) v.findViewById(R.id.et_message);
    }

    protected void setUpView() {
        tvQuestionTitle.setText(position + 1 + ". " + bean.getTitle());
        etMessage.setHint(bean.getTitle());
    }

    public String getPosition() {
        return bean.getQnumber();
    }

    public String getSurveyAnswer() {
        return etMessage.getText().toString().trim();
    }
}
